package com.newx.common.core.domain.model;

import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import static com.newx.common.core.constant.UserConstants.PASSWORD_MAX_LENGTH;
import static com.newx.common.core.constant.UserConstants.PASSWORD_MIN_LENGTH;

/**
 * 用户注册对象
 *
 * @author Lion Li
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class RegisterBody extends LoginBody {

    /**
     * 用户名
     */
    private String username;

    /**
     * 用户密码
     */
    @NotBlank(message = "{user.password.not.blank}")
    @Length(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String password;

    /**
     * App和PC统一传递：app_user
     */
    @NotBlank(message = "{user.usertype.not.blank}")
    private String userType;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 手机号
     */
    private String phonenumber;

    /**
     * 用户昵称
     */
    @NotBlank(message = "{user.nickname.not.blank}")
    private String nickName;

    /**
     * 钱包地址
     */
    private String address;

    /**
     * 邀请码
     */
    private String activeCode;

}
